<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@include file="/inc/taglibs.jsp" %>
<style>
</style>
<script>
function save(form){
	var title=$("#title").val();
	var url=$("#url").val();
	var keyword=$("#keyword").val();
	if(title==""||url==""||keyword==""){
		showTip("未填完整数据！",null,5);
		return false;
	}else{
		if(keyword.split(" ").length>8||keyword.split(" ").length<3){
			showTip("关键字不能超过8个且不能少于3个",null,5);
			return false;
		}
	}
	ajaxSubmit(form,function(msg){
		showTip(msg.msg,null,1);
		if(msg.stat=="S"){
			$("#websiteid").html('<input type="hidden" name="id" id="websiteid" value="'+msg.id+'">');
			setTimeout('$("#menu4").click();',500);
		}
	});
	return false;
}
</script>
<div>
<form action="${path }/website/save" onsubmit="return save(this);">
<div id="form_div">
<input type="hidden" name="userid" value="${website.userid}">
<input type="hidden" name="id" value="${website.id}">
	<ul>
		<li><div class="fieldtitle">标题:</div><div class="field"><input type="text" name="title"id="title" value="${website.title}"></div><div class="fieldmsg"></div></li>
		<li><div class="fieldtitle">网址:</div><div class="field"><input type="text" name="url" id="url" value="${website.url}"></div><div class="fieldmsg"></div></li>
		<li><div class="fieldtitle">关键字:</div><div class="field"><input type="text" name="keyword"id="keyword" value="${website.keyword}"></div><div class="fieldmsg">多个关键字以空格分隔,最多8个</div></li>
		<li><div class="fieldtitle">&nbsp;</div><div class="field"><button type="submit">保存</button></div></li>
	</ul>
</div>
</form>
</div>